<?php
	## get only google plus
	## <!-- Đặt thẻ này ở <head> hoặc ngay trước thẻ </body> -->
	## <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
	## http://www.google.com/intl/vi/webmasters/+1/button/
	function social_get_google_plus()
	{
		return '<g:plusone></g:plusone>';
	}
	
	
	## facebook like
	## su dung: <li>  facebook_like(get_bloginfo('home')) </li>
	## http://developers.facebook.com/docs/reference/plugins/like/
	
	function facebook_like($l, $fb = true)
	{
	     echo '<script type="text/javascript">
    //<![CDATA[
    ';
    if($fb)
        echo '(function() {
        var target = document.createElement(\'SCRIPT\');
        var anchor = document.getElementsByTagName(\'SCRIPT\')[0];
        document.write(\'<div class="fb-like" data-send="false" data-layout="button_count" data-width="30" data-show-faces="true" data-font="arial"></div>\');
        target.src= \'http://connect.facebook.net/en_US/all.js#xfbml=1\';
        target.type = \'text/javascript\';
        anchor.parentNode.insertBefore(target, anchor);
        })();';

    echo '//]]>
       </script>';
	}
	
	
	## tweet so dung:	
    ## <li> tweet_like(get_bloginfo('home'))</li>     
	function tweet_like($l, $tw = true)
	{
	    echo '<script type="text/javascript">
	    //<![CDATA[
	    ';  
	    if($tw)
	        echo '(function() {
	        var target = document.createElement(\'SCRIPT\')
	        var anchor = document.getElementsByTagName(\'SCRIPT\')[0];
	
	        document.write(\'<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-url="',$l,'" data-via="REPLACEME">Tweet</a>\');
	        target.src = \'http://platform.twitter.com/widgets.js\';
	        target.type = "text/javascript";
	        target.async = true;
	        anchor.parentNode.insertBefore(target, anchor);
	    })();
	    ';
	
	    echo '//]]>
	       </script>';
	}
	
	## get face share
	function facebook_share()
	{
		return '<a href="http://www.facebook.com/sharer/sharer.php?u='.get_permalink().'" class="share-1">';
	}
	
	## get tweet share
	function tweet_share()
	{
		return '<a href="http://twitter.com/share" class="share-2">';
	}	
	
	## rss feed
	function feed_rss()
	{
		return '<a href="'.get_bloginfo("home").'/feed/" class="share-3">';
	}
	?>